From: Colin Walters Date: Fri, 16 May 2025 20:19:48 +0000 (-0400) Subject: rust: Update to 2025.2 X-Git-Tag: archive/raspbian/2025.7-2+rpi1^2^2~6^2~4^2~30^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f4cc1fd239297b73b3db908c7f351e80159ca0d3;p=ostree.git rust: Update to 2025.2 I want the set_null_log in particular. --- diff --git a/rust-bindings/src/auto/constants.rs b/rust-bindings/src/auto/constants.rs index c4651354..602ce485 100644 --- a/rust-bindings/src/auto/constants.rs +++ b/rust-bindings/src/auto/constants.rs @@ -69,6 +69,10 @@ pub static REPO_METADATA_REF: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked( #[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] #[doc(alias = "OSTREE_SIGN_NAME_ED25519")] pub static SIGN_NAME_ED25519: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SIGN_NAME_ED25519)}; +#[cfg(feature = "v2024_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2024_7")))] +#[doc(alias = "OSTREE_SIGN_NAME_SPKI")] +pub static SIGN_NAME_SPKI: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SIGN_NAME_SPKI)}; #[doc(alias = "OSTREE_SUMMARY_GVARIANT_STRING")] pub static SUMMARY_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SUMMARY_GVARIANT_STRING)}; #[doc(alias = "OSTREE_SUMMARY_SIG_GVARIANT_STRING")] diff --git a/rust-bindings/src/auto/gpg_verify_result.rs b/rust-bindings/src/auto/gpg_verify_result.rs index 7733d32d..25dea772 100644 --- a/rust-bindings/src/auto/gpg_verify_result.rs +++ b/rust-bindings/src/auto/gpg_verify_result.rs @@ -30,7 +30,7 @@ impl GpgVerifyResult { } //#[doc(alias = "ostree_gpg_verify_result_get")] - //pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 19 }) -> glib::Variant { + //pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 21 }) -> glib::Variant { // unsafe { TODO: call ffi:ostree_gpg_verify_result_get() } //} diff --git a/rust-bindings/src/auto/mod.rs b/rust-bindings/src/auto/mod.rs index d9305546..d5ab73b2 100644 --- a/rust-bindings/src/auto/mod.rs +++ b/rust-bindings/src/auto/mod.rs @@ -178,6 +178,9 @@ pub use self::constants::REPO_METADATA_REF; #[cfg(feature = "v2020_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] pub use self::constants::SIGN_NAME_ED25519; +#[cfg(feature = "v2024_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2024_7")))] +pub use self::constants::SIGN_NAME_SPKI; pub use self::constants::SUMMARY_GVARIANT_STRING; pub use self::constants::SUMMARY_SIG_GVARIANT_STRING; pub use self::constants::TREE_GVARIANT_STRING; diff --git a/rust-bindings/src/auto/mutable_tree.rs b/rust-bindings/src/auto/mutable_tree.rs index 74255e69..f560eede 100644 --- a/rust-bindings/src/auto/mutable_tree.rs +++ b/rust-bindings/src/auto/mutable_tree.rs @@ -114,7 +114,7 @@ impl MutableTree { //#[doc(alias = "ostree_mutable_tree_get_subdirs")] //#[doc(alias = "get_subdirs")] - //pub fn subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 23 } { + //pub fn subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 25 } { // unsafe { TODO: call ffi:ostree_mutable_tree_get_subdirs() } //} diff --git a/rust-bindings/src/auto/se_policy.rs b/rust-bindings/src/auto/se_policy.rs index 6bbec0d8..e8337718 100644 --- a/rust-bindings/src/auto/se_policy.rs +++ b/rust-bindings/src/auto/se_policy.rs @@ -108,6 +108,15 @@ impl SePolicy { pub fn rootfs_dfd(&self) -> i32 { ObjectExt::property(self, "rootfs-dfd") } + + #[cfg(feature = "v2025_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + #[doc(alias = "ostree_sepolicy_set_null_log")] + pub fn set_null_log() { + unsafe { + ffi::ostree_sepolicy_set_null_log(); + } + } } unsafe impl Send for SePolicy {} diff --git a/rust-bindings/src/auto/sign.rs b/rust-bindings/src/auto/sign.rs index 1748d742..bda6c8c4 100644 --- a/rust-bindings/src/auto/sign.rs +++ b/rust-bindings/src/auto/sign.rs @@ -163,6 +163,20 @@ pub trait SignExt: IsA + 'static { } } + //#[cfg(feature = "v2025_2")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + //#[doc(alias = "ostree_sign_read_pk")] + //fn read_pk(&self, stream: &impl IsA) -> /*Ignored*/BlobReader { + // unsafe { TODO: call ffi:ostree_sign_read_pk() } + //} + + //#[cfg(feature = "v2025_2")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + //#[doc(alias = "ostree_sign_read_sk")] + //fn read_sk(&self, stream: &impl IsA) -> /*Ignored*/BlobReader { + // unsafe { TODO: call ffi:ostree_sign_read_sk() } + //} + #[cfg(feature = "v2020_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] #[doc(alias = "ostree_sign_set_pk")] diff --git a/rust-bindings/src/auto/versions.txt b/rust-bindings/src/auto/versions.txt index 0ee05397..f46cfa17 100644 --- a/rust-bindings/src/auto/versions.txt +++ b/rust-bindings/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 5433e2582f83) -from gir-files (@ b89f209a09cf) +from gir-files (@ 7a32b86ee4c0) diff --git a/rust-bindings/sys/Cargo.toml b/rust-bindings/sys/Cargo.toml index 6312cc5b..de4815a9 100644 --- a/rust-bindings/sys/Cargo.toml +++ b/rust-bindings/sys/Cargo.toml @@ -70,6 +70,7 @@ v2023_8 = ["v2023_1"] v2023_11 = ["v2023_8"] v2025_1 = ["v2024_7"] v2024_7 = ["v2023_11"] +v2025_2 = ["v2025_1"] [lib] name = "ostree_sys" @@ -249,3 +250,6 @@ version = "2025.1" [package.metadata.system-deps.ostree_1.v2024_7] version = "2024.7" + +[package.metadata.system-deps.ostree_1.v2025_2] +version = "2025.2" diff --git a/rust-bindings/sys/src/auto/versions.txt b/rust-bindings/sys/src/auto/versions.txt index 0ee05397..f46cfa17 100644 --- a/rust-bindings/sys/src/auto/versions.txt +++ b/rust-bindings/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 5433e2582f83) -from gir-files (@ b89f209a09cf) +from gir-files (@ 7a32b86ee4c0) diff --git a/rust-bindings/sys/src/lib.rs b/rust-bindings/sys/src/lib.rs index c9b57148..e79027f3 100644 --- a/rust-bindings/sys/src/lib.rs +++ b/rust-bindings/sys/src/lib.rs @@ -152,6 +152,7 @@ pub const OSTREE_REPO_METADATA_REF: &[u8] = b"ostree-metadata\0"; pub const OSTREE_SHA256_DIGEST_LEN: c_int = 32; pub const OSTREE_SHA256_STRING_LEN: c_int = 64; pub const OSTREE_SIGN_NAME_ED25519: &[u8] = b"ed25519\0"; +pub const OSTREE_SIGN_NAME_SPKI: &[u8] = b"spki\0"; pub const OSTREE_SUMMARY_GVARIANT_STRING: &[u8] = b"(a(s(taya{sv}))a{sv})\0"; pub const OSTREE_SUMMARY_SIG_GVARIANT_STRING: &[u8] = b"a{sv}\0"; pub const OSTREE_TIMESTAMP: c_int = 0; @@ -300,6 +301,28 @@ impl ::std::fmt::Debug for OstreeAsyncProgressClass { } } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct OstreeBlobReaderInterface { + pub g_iface: gobject::GTypeInterface, + pub read_blob: Option< + unsafe extern "C" fn( + *mut OstreeBlobReader, + *mut gio::GCancellable, + *mut *mut glib::GError, + ) -> *mut glib::GBytes, + >, +} + +impl ::std::fmt::Debug for OstreeBlobReaderInterface { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("OstreeBlobReaderInterface @ {self:p}")) + .field("g_iface", &self.g_iface) + .field("read_blob", &self.read_blob) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct OstreeCollectionRef { @@ -1119,6 +1142,19 @@ impl ::std::fmt::Debug for OstreeSysrootUpgrader { } // Interfaces +#[repr(C)] +#[allow(dead_code)] +pub struct OstreeBlobReader { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +impl ::std::fmt::Debug for OstreeBlobReader { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + write!(f, "OstreeBlobReader @ {self:p}") + } +} + #[repr(C)] #[allow(dead_code)] pub struct OstreeRepoFinder { @@ -2998,6 +3034,9 @@ extern "C" { error: *mut *mut glib::GError, ) -> *mut OstreeSePolicy; pub fn ostree_sepolicy_fscreatecon_cleanup(unused: *mut *mut c_void); + #[cfg(feature = "v2025_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + pub fn ostree_sepolicy_set_null_log(); #[cfg(feature = "v2016_5")] #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_sepolicy_get_csum(self_: *mut OstreeSePolicy) -> *const c_char; @@ -3396,6 +3435,16 @@ extern "C" { error: *mut *mut glib::GError, ) -> gboolean; + //========================================================================= + // OstreeBlobReader + //========================================================================= + pub fn ostree_blob_reader_get_type() -> GType; + pub fn ostree_blob_reader_read_blob( + self_: *mut OstreeBlobReader, + cancellable: *mut gio::GCancellable, + error: *mut *mut glib::GError, + ) -> *mut glib::GBytes; + //========================================================================= // OstreeRepoFinder //========================================================================= @@ -3554,6 +3603,18 @@ extern "C" { #[cfg(feature = "v2020_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_metadata_key(self_: *mut OstreeSign) -> *const c_char; + #[cfg(feature = "v2025_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + pub fn ostree_sign_read_pk( + self_: *mut OstreeSign, + stream: *mut gio::GInputStream, + ) -> *mut OstreeBlobReader; + #[cfg(feature = "v2025_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + pub fn ostree_sign_read_sk( + self_: *mut OstreeSign, + stream: *mut gio::GInputStream, + ) -> *mut OstreeBlobReader; #[cfg(feature = "v2020_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_set_pk( diff --git a/rust-bindings/sys/tests/abi.rs b/rust-bindings/sys/tests/abi.rs index c6efb83a..cf5a3474 100644 --- a/rust-bindings/sys/tests/abi.rs +++ b/rust-bindings/sys/tests/abi.rs @@ -208,6 +208,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "OstreeBlobReaderInterface", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "OstreeChecksumFlags", Layout { @@ -743,6 +750,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("OSTREE_SHA256_DIGEST_LEN", "32"), ("OSTREE_SHA256_STRING_LEN", "64"), ("OSTREE_SIGN_NAME_ED25519", "ed25519"), + ("OSTREE_SIGN_NAME_SPKI", "spki"), ("(gint) OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY", "0"), ("(gint) OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR", "1"), ("(gint) OSTREE_STATIC_DELTA_INDEX_FLAGS_NONE", "0"), diff --git a/rust-bindings/sys/tests/layout.c b/rust-bindings/sys/tests/layout.c index 0def4cc7..3db57845 100644 --- a/rust-bindings/sys/tests/layout.c +++ b/rust-bindings/sys/tests/layout.c @@ -8,6 +8,7 @@ int main() { printf("%s;%zu;%zu\n", "OstreeAsyncProgressClass", sizeof(OstreeAsyncProgressClass), alignof(OstreeAsyncProgressClass)); + printf("%s;%zu;%zu\n", "OstreeBlobReaderInterface", sizeof(OstreeBlobReaderInterface), alignof(OstreeBlobReaderInterface)); printf("%s;%zu;%zu\n", "OstreeChecksumFlags", sizeof(OstreeChecksumFlags), alignof(OstreeChecksumFlags)); printf("%s;%zu;%zu\n", "OstreeCollectionRef", sizeof(OstreeCollectionRef), alignof(OstreeCollectionRef)); printf("%s;%zu;%zu\n", "OstreeCollectionRefv", sizeof(OstreeCollectionRefv), alignof(OstreeCollectionRefv));